package casa.depesos.app.com.http.req;


import java.util.Map;

import casa.depesos.app.com.http.HttpReq;
import casa.depesos.app.com.http.ReqCallback;
import casa.depesos.app.com.http.bean.RegBean;
import casa.depesos.app.com.http.parser.RegParser;
import casa.depesos.app.com.utils.Constant;

public class RegReq implements HttpReq<RegBean> {

    String phone, pwd, code;

    public RegReq(String phone, String pwd, String code) {
        this.phone = phone;
        this.pwd = pwd;
        this.code = code;
    }

    @Override
    public void req(ReqCallback<RegBean> callback) {//  /app/user/register
        req("/app/consumer/enroll", new RegParser(), callback);
    }

    @Override
    public Map getBody() {
        Map map = HttpReq.super.getBody();
        map.put("mobile", phone);
        map.put("validatiCod", code);
        map.put("authentication", pwd);
        map.put("passwordVerification", pwd);

        map.put("sampID", Constant.instanceId);
        map.put("adID", Constant.adid);
        map.put("gpsAdID", Constant.gpsAdid);
        map.put("altGPSAdID", Constant.adjustGpsAdid);

        return map;
    }
}
